.markdown p:first-child,
.markdown .paragraph:first-child {
  /* This is needed when markdown is used inside buttons or labels  */
  margin-block-start: 0;
}

.markdown p:last-child,
/* This is needed when markdown is used inside buttons or labels  */
.markdown .paragraph:last-child {
  margin-block-end: 0;
}


.markdown h1 {
  text-align: center;
}

.config-width-full .markdown h1 {
  /* In full-width display, we left-align the title */
  text-align: start;
}


.markdown .paragraph {
  /*
  we convert <p> to span.paragraph to support nesting,
  so we need to apply the same formatting
  */
  display: block;
  margin-block: 1rem 1rem;
  margin-inline: 0 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  font-weight: inherit;
  font-family: var(--heading-font);
}

.markdown a {
  cursor: pointer;
  text-decoration: inherit;

  @apply text-link;
}

.markdown a:hover,
.markdown a:active {
  text-decoration: underline;
}

.markdown a:visited {
  @apply text-link-visited;
}

.mo-label .markdown p,
.mo-label-block .markdown p,
.mo-label .markdown .paragraph,
.mo-label-block .markdown .paragraph {
  /* This is needed when markdown is used inside labels  */
  padding: 0;
  margin: 0;
}

/* stylelint-disable unit-allowed-list */

/* pad iconify-icon when next to text */
a .markdown .paragraph:has(iconify-icon) {
  gap: 0.4em;
}

/* pad iconify-icon when in navigation items */
a .markdown iconify-icon:first-child {
  margin-inline-end: 0.4em;
}

/* align icons with buttons better */
button .markdown .paragraph {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;

  iconify-icon {
    align-self: center;
  }
}

/* stylelint-enable unit-allowed-list */
